"""统计平均值比率。结果从大到小排序。接受最小值和最大值。"""


def get_avg_rates(numbers):
    avg = sum(numbers) / len(numbers)
    result = [n / avg for n in numbers]
    result.sort(reverse=True)
    return result


lengths = [64, 62, 74, 63, 77, 71, 64, 71, 68, 65]

avg_rates = get_avg_rates(lengths)
shortest = avg_rates[-1]
longest = avg_rates[0]
print(f"Shortest: {shortest:>4.0%}, Longest: {longest:>4.0%}")
